package com.loyal.loyalerp.humenresource.category.service.imp;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.loyal.loyalerp.humenresource.category.entity.Gy_ConfigType;
import com.loyal.loyalerp.humenresource.category.mapper.Gy_ConfigTypeMapper;
import com.loyal.loyalerp.humenresource.category.service.ConfigTypeWriteService;

@Service
public class ConfigTypeWriteServiceImp implements ConfigTypeWriteService{

	@Autowired
	private Gy_ConfigTypeMapper mapper;
	
	@Override
	public String deleteConfigType(int id) {
		// TODO Auto-generated method stub
		if(mapper.deleteByPrimaryKey(id)>=1) {
			return "success";
		}
		return "fail";
			
	}

	@Override
	public String editConfigType(Gy_ConfigType configType) {
		// TODO Auto-generated method stub
		if(mapper.updateByPrimaryKey(configType)>=1) {
			return "success";
		}
		return "fail";
	}

	@Override
	public int addConfigType(Gy_ConfigType con) {
		// TODO Auto-generated method stub
		return mapper.insert(con);
	}

}
